/*********************
* Author:Dzlua
* QQ:505544956
* time:2016/12/02
*/
#ifndef __EDUI_LUAEDIT_H__
#define __EDUI_LUAEDIT_H__

#include "../../controls/Edit.h"
#include "LuaLabel.h"

#ifdef EDUI_USE_LUAPLUS

EDUI_NAMESPACE_BEGIN

class LuaEdit : public LuaLabel
{
public:
    LuaEdit(Edit* edit);
    virtual ~LuaEdit();
    static void* GetInterface(void* data);
    virtual void Release();
    static void Register(LuaState *L);
public:
    int GetTipFont(LuaState *L);
    int SetTipFont(LuaState *L);
    void SetText(const char* text);
    int ReplaceText(LuaState *L);
    bool DeleteText(int begin, int end);
    void ClearText();
    int GetText(LuaState *L);
    void SelAllText();
    void SelText(int begin, int end);
    int ReplaceSel(LuaState *L);
    void DeleteSel();
    int GetSel(LuaState *L);
    int GetSelText(LuaState *L);
    int GetSelPos(LuaState *L);
    void DeletePrev();
    void DeleteNext();
    void Copy();
    void Cut();
    void Paste();
    void Delete();
    void BackSpace();
    void SetCursorNextPos();
    void SetCursorPrevPos();
    void SetCursorPos(int pos);
    int GetCursorPos();
    void EnableCursor(bool bEnable);
    void EnableSel(bool bEnable);
    void ReadOnly(bool bOnlyRead);
    void SetMaxChar(int maxchar);
    void SetTipText(const char* text);
    const char* GetTipText();
    void SetReadOnly(bool readonly);
    bool IsReadOnly();
    void SetUsePassWord(bool use);
    bool IsUsedPassWord();
    const char* GetPassWordText();
    void SetPassWordMask(const char* mask);
    const char* GetPassWordMask();
    void SetInputRegex(const char* regex);
    void SetVerifyRegex(const char* regex);
    int Verify(LuaState *L);
};

EDUI_NAMESPACE_END

#endif
#endif